remus: use plug qdisc for network buffering instead of queue
authorBrendan Cully <brendan@cs.ubc.ca>
Tue, 7 Sep 2010 18:13:55 +0000 (19:13 +0100)
committerBrendan Cully <brendan@cs.ubc.ca>
Tue, 7 Sep 2010 18:13:55 +0000 (19:13 +0100)
It was renamed in the pvops [kernel] tree.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/python/xen/remus/device.py
tools/python/xen/remus/qdisc.py

index a0e50cc8a84b896b205e14ceb4256fae848618b8..047e9bf79a045d6b785efa1a2ea7b803f44d90dd 100644 (file)
@@ -281,12 +281,12 @@ class BufferedNIC(CheckpointedDevice):
         if not self.installed:
             self.install()
 
-        self._sendqmsg(qdisc.TC_QUEUE_CHECKPOINT)
+        self._sendqmsg(qdisc.TC_PLUG_CHECKPOINT)
 
     def commit(self):
         '''Called when checkpoint has been acknowledged by
         the backup'''
-        self._sendqmsg(qdisc.TC_QUEUE_RELEASE)
+        self._sendqmsg(qdisc.TC_PLUG_RELEASE)
 
     # private
     def _sendqmsg(self, action):
@@ -296,7 +296,7 @@ class BufferedNIC(CheckpointedDevice):
         return True
 
     def setup(self):
-        """install Remus queue on VIF outbound traffic"""
+        """install Remus plug on VIF outbound traffic"""
         self.bufdev = self.pool.get()
 
         devname = self.bufdev.devname
@@ -308,19 +308,19 @@ class BufferedNIC(CheckpointedDevice):
 
         self.bufdevno = bufdev['index']
         self.handle = qdisc.TC_H_ROOT
-        self.q = qdisc.QueueQdisc()
+        self.q = qdisc.PlugQdisc()
 
-        if not util.modprobe('sch_queue'):
-            raise BufferedNICException('could not load sch_queue module')
+        if not util.modprobe('sch_plug'):
+            raise BufferedNICException('could not load sch_plug module')
 
     def install(self):
         devname = self.bufdev.devname
         q = self.rth.getqdisc(self.bufdevno)
         if q:
-            if q['kind'] == 'queue':
+            if q['kind'] == 'plug':
                 self.installed = True
                 return
-            if q['kind'] != 'pfifo_fast':
+            if q['kind'] not in ('ingress', 'pfifo_fast'):
                 raise BufferedNICException('there is already a queueing '
                                            'discipline on %s' % devname)
 
index 6118cd929572f188a2f07b6b34d7c6631c1f1cc4..e7d3b706a5fff9a34edc0cae02a5298e504ee650 100644 (file)
@@ -146,17 +146,17 @@ class CfifoQdisc(Qdisc):
 
 qdisc_kinds['cfifo'] = CfifoQdisc
 
-TC_QUEUE_CHECKPOINT = 0
-TC_QUEUE_RELEASE = 1
+TC_PLUG_CHECKPOINT = 0
+TC_PLUG_RELEASE = 1
 
-class QueueQdisc(Qdisc):
+class PlugQdisc(Qdisc):
     fmt = 'I'
 
     def __init__(self, qdict=None):
         if not qdict:
-            qdict = {'kind': 'queue',
+            qdict = {'kind': 'plug',
                      'handle': TC_H_ROOT}
-        super(QueueQdisc, self).__init__(qdict)
+        super(PlugQdisc, self).__init__(qdict)
 
         self.action = 0
 
@@ -169,10 +169,10 @@ class QueueQdisc(Qdisc):
         arg = args[0]
 
         if arg == 'checkpoint':
-            self.action = TC_QUEUE_CHECKPOINT
+            self.action = TC_PLUG_CHECKPOINT
         elif arg == 'release':
-            self.action = TC_QUEUE_RELEASE
+            self.action = TC_PLUG_RELEASE
         else:
             raise QdiscException('unknown action')
 
-qdisc_kinds['queue'] = QueueQdisc
+qdisc_kinds['plug'] = PlugQdisc